package com.endava.first;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ParsingCreditNumber {

	public static void main(String[] args) {
		Pattern p2 = Pattern.compile("^(([0-9]{4} ){3}(([0-9]{4})|([0-9]{3})))$");
		Matcher m2 = p2.matcher("0600 0000 0000 000");
		while (m2.find()) {
			System.out.println(m2.start() + " " + m2.group());
		}
	}

}
